import React from 'react'
import ReactDOM from 'react-dom'

const a = 10
let str ='hello world'
let bool = true
const h1 = <h1>这是const定义的h1</h1>
const arr = [<h1>这是const定义的h1</h1>,<h2>这是const定义的h2</h2>,<h3>这是const定义的h3</h3>]

let arrStr = ['诸葛亮','小强','孙悟空','如来佛']

const nameArr=[]

//React中，需要把key添加给被forEach map for循环直接控制的元素
arrStr.forEach(item=>{
    nameArr.push(<div key={item}>{item}</div>)
})

const g = arrStr.map(item=>{
    return <h2 key={item}>{item}</h2>
})

ReactDOM.render(
    <div>
        123-{a*100} 
        <hr/>
        {str}
        <hr/>
        {bool ? '真的':'假的'}
        <hr/>
        <p>this is the paramgamer</p>
        <hr/>
        <p tilte={str}></p>
        <hr/>
        {h1}
        <hr/>
        {/* {arr} */}
        {nameArr}
        <hr/>
        {g}
        <hr/>
        {arrStr.map(item=><h3 key={item}>{item+item}</h3>)}
        <hr/>
        <div className="mydiv">!!!!!!</div>
        <label htmlFor="ooo">111111</label>

    </div>,document.getElementById('app'))